$(function(){
    // 循环添加热门试用图片
    var cttimgSz = [
        '(../img1/hot9.jpg)',
        '(../img1/hot10.jpg)',
        '(../img1/hot11.jpg)',
        '(../img1/hot12.jpg)',   
        '(../img1/g1.jpg)',
        '(../img1/g2.jpg)',
        '(../img1/g3.jpg)',
        '(../img1/g4.jpg)',   
        '(../img1/detail4.jpg)',   
        '(../img1/detail1.jpg)',
        '(../img1/detail2.jpg)',
        '(../img1/detail3.jpg)',
        '(../img1/g3.jpg)',
        '(../img1/g4.jpg)',   
        '(../img1/detail4.jpg)',   
        '(../img1/detail1.jpg)'
    ]
    var cttimg = $('.cttimg')
    console.log(cttimg);

    cttimg.each(function(index,itme){
        $(itme).css('background','url'+cttimgSz[index])
        $(itme).css('background-size','cover')
    })

    // 发现酷玩     添加元素
    var ctt4obj = {
        ctt4img:[1,2,3,4],
        ctt4p1:['SCiO 微型光谱仪','B&O BeoSound 35 音响','Mozbii 触控吸色笔','XPLORER 2 航拍飞行器'],
        ctt4p2:['可以测定食物成分及营养','支持所有音乐流媒体服务','能吸取65000种颜色','搭载自动避障系统'],
        ctt4p3:['￥ 1212','￥ 512','￥ 暂无','￥ 433']
    }
    var cttbox4 = $('.cttbox4')
    for (var i = 0; i < 4 ;i++) {
        for (var ii = 0; ii < 4; ii++) {
            var ctt4text = $(
                `<div class="cttbox1">
                    <div class="cttimg">
                        <img  class="cttimg1" src="./img1/k${ctt4obj.ctt4img[ii]}.jpg" alt="">
                    </div>
                    <p class="bgP ctt4p1">${ctt4obj.ctt4p1[ii]}</p>
                    <p class="bgP ctt4p2">${ctt4obj.ctt4p2[ii]}</p>
                    <div class="cttXia">
                        <div class="cttXt ctt4p3">${ctt4obj.ctt4p3[ii]}</div>
                        <div class="cttXi">
                            <img src="./img/xin.png" >3
                            <img src="./img/reply.png" >3
                        </div>
                    </div>
                </div>`)
            cttbox4.append(ctt4text)
        } 
    }
})

var a = $('.cttbox4')
console.log(a);